<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <style type="text/css">
            .pic{
                margin-bottom: -4px;
                margin-right: 2px;
                border:none;
            }
            .inText{
                width: 220px;
                float:right;
            }
            .oinText{
                width: 220px;
            }
        </style>
        <script type="text/javascript">
            function reset(){
                document.getElementById('queryCondition:id').value = "";
                document.getElementById('queryCondition:name').value = "";
                document.getElementById('queryCondition:simplename').value = "";
                document.getElementById('queryCondition:partnertypecode').value = "";
                document.getElementById('queryCondition:partnertype').value = "";
                document.getElementById('queryCondition:grade').value = "";
                document.getElementById('queryCondition:check').value = "";
            }            
        </script>
    </h:head>
    <body>
        <h:form id="emp">
            <rich:panel header="客商信息">           
                <rich:toolbar  itemSeparator="grid">
                    <rich:toolbarGroup>
                        <h:commandButton value="新建" action="#{partner.add}"/>
                        <h:commandButton value="修改" action="#{partner.update}" disabled="#{!partner.showAble}"/>
                        <h:commandButton value="删除" action="#{partner.delete}" disabled="#{!partner.showAble}"/>
                        <h:commandButton value="保存" action="#{partner.save}" disabled="#{!partner.showAble}"/>
                        <h:commandButton value="取消" action="#{partner.cancel}" disabled="#{!partner.showAble}"/>
                    </rich:toolbarGroup>
                </rich:toolbar>
                <h:panelGrid  style="width:100%;" columns="4">
                    <h:outputLabel value="代码：" for="code"/>
                    <h:inputText styleClass="oinText" disabled="#{!partner.showAble}" id="code" value="#{partner.partner.id}"  immediate="true"/>

                    <h:outputLabel value="名称：" for="name"/>
                    <h:inputText  styleClass="inText"  disabled="#{!partner.showAble}" id="name"  value="#{partner.partner.name}"/>

                    <h:outputLabel value="简称：" for="simplename"/>
                    <h:inputText styleClass="oinText"   disabled="#{!partner.showAble}" id="simplename"  value="#{partner.partner.simplename}"/>

                    <h:outputLabel value="法人：" for="faren"/>
                    <h:inputText  styleClass="inText"   disabled="#{!partner.showAble}" id="faren"  value="#{partner.partner.legalPerson}" />

                    <h:outputLabel value="电话：" for="faren"/>
                    <h:inputText  styleClass="oinText"  disabled="#{!partner.showAble}" id="tele"  value="#{partner.partner.tele}" />

                    <h:outputLabel value="传真：" for="faxcode"/>
                    <h:inputText  styleClass="inText"  disabled="#{!partner.showAble}" id="faxcode"  value="#{partner.partner.fax}"/>

                    <h:outputLabel value="地址：" for="address"/>
                    <h:inputText  styleClass="oinText"   disabled="#{!partner.showAble}" id="address"  value="#{partner.partner.address}"/>

                    <h:outputLabel value="邮编：" for="zipcode"/>
                    <h:inputText  styleClass="inText"  disabled="#{!partner.showAble}" id="zipcode"  value="#{partner.partner.zipcode}"/>

                    <h:outputLabel value="邮箱：" for="email"/>
                    <h:inputText  styleClass="oinText"  disabled="#{!partner.showAble}" id="email"  value="#{partner.partner.email}"/>

                    <h:outputLabel value="联系人：" for="relationer"/>
                    <h:inputText  styleClass="inText"  disabled="#{!partner.showAble}" id="relationer"  value="#{partner.partner.relationer}" />

                    <h:outputLabel value="手机号：" for="mobile"/>
                    <h:inputText  styleClass="oinText"  disabled="#{!partner.showAble}" id="mobile"  value="#{partner.partner.mobile}"/>

                    <h:outputLabel value="开户银行：" for="bank"/>
                    <h:inputText  styleClass="inText"  disabled="#{!partner.showAble}" id="bank"  value="#{partner.partner.bank}" />

                    <h:outputLabel value="银行账号：" for="account"/>
                    <h:inputText  styleClass="oinText"  disabled="#{!partner.showAble}" id="account"  value="#{partner.partner.bankAccount}" />
                </h:panelGrid>
                <hr/>
                <rich:dataTable id="editTable" value="#{partner.partnerModel}" var="emp" rows="10"
                                rowClasses="list-row-odd,list-row-even"
                                headerClass="table-header" >

                    <rich:column>
                        <f:facet name="header">
                            <h:outputText value="代码"/>
                        </f:facet>
                        <h:commandLink action="#{partner.show}">
                            <h:outputText value="#{emp.id}"/>
                        </h:commandLink>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">
                            <h:outputText value="名称"/>
                        </f:facet>
                        <h:outputText value="#{emp.name}"/>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">
                            <h:outputText value="简称"/>
                        </f:facet>
                        <h:outputText value="#{emp.simplename}"/>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:dataScroller id="ds"></rich:dataScroller>
                    </f:facet>

                </rich:dataTable> 
            </rich:panel>
        </h:form>
    </body>
</html>
